package com.qm.console.component.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @Auther: yilu
 * @Date: 2018/12/10 15:00
 * @Description:
 */
@Configuration
public class WebCrossConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*","http://192.168.1.62")
                .allowedMethods("GET", "POST", "OPTIONS", "PUT", "DELETE", "PATCH")
//                .allowCredentials(true)
                .maxAge(3600);
    }

}
